package com.lixw.langchain.controller;

import cn.hutool.core.date.DateUtil;
import com.lixw.langchain.service.FunctionAssistant;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: ChatFunctionCallingController
 * @Description:
 * @Author: xuweiLi
 * @Create: 2025/8/24 15:10
 **/
@Slf4j
@RestController
public class ChatFunctionCallingController {
    @Resource
    private FunctionAssistant functionAssistant;

    @GetMapping("/chatfunction/test")
    public String test() {
        String chat = functionAssistant.chat("开张发票,公司：尚硅谷教育科技有限公司 税号：atguigu533 金额：668.12, 顺便帮我查询一下城市id为101010100的天气信息");

        log.info(chat);

        return "success : "+ DateUtil.now() + "\t"+chat;
    }

}